<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonModule for the canonical source repository
 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace TtkCompress\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\Filter\Compress\Rar;

class TtkRarController extends AbstractActionController
{
public function indexAction()
    {
        return array();
    }

    public function createRarAction()
    {
        if($this->getRequest()->isPost())
        {
        	$name = $this->params()->fromPost('name');
        	
        	$path = ROOT_PATH.'/system/TtkCompress/data/zip/input/'.$name;
        	
        	if(!is_dir($path.'.rar'))
        	{
        		fopen($path.'.rar', 'w');
        	}
        	
        	$options = array(
		        'archive' => $path.'.zip',
		        'target'  => $path,
		    );
        	
        	
        	
        }
        return array();
    }
    
    public function extractRarAction()
    {
    	// This shows the :controller and :action parameters in default route
    	// are working when you browse to /module-specific-root/skeleton/foo
    	return array();
    }
    
}
